package edu.npu.cv.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.npu.cv.vo.MemberVO;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;

@Data
@TableName("tb_member")
@ToString
public class MemberDO implements Serializable {
    /**
     * id
     */

    @TableId
    @Excel(name = "序列号", width = 25)
    private long id;

    /**
     * name
     */
    @Excel(name = "名字", width = 25)
    private String name;

    /**
     * degree
     */
    @Excel(name = "学位", width = 25)
    private String degree;

    /**
     * subject
     */
    @Excel(name = "研究方向/个人简介", width = 25)
    private String subject;

    /**
     * imgurl
     */
    @Excel(name = "图片地址", width = 25)
    private String imgUrl;

    /**
     * introduction
     */
    @Excel(name = "介绍", width = 25)
    private String introduction;

    /**
     * 详细介绍
     *
     */
    private String introductionDetail;

    public static MemberDO transMemberVO2DO(MemberVO memberVO) {
        MemberDO memberDO = new MemberDO();
        memberDO.setId(memberVO.getMemberId() >= 0 ? memberVO.getMemberId() : 0L);
        memberDO.setDegree(memberVO.getDegree());
        memberDO.setImgUrl(memberVO.getMemberImg());
        memberDO.setIntroduction(memberVO.getIntroduction());
        memberDO.setSubject(memberVO.getSubject());
        memberDO.setIntroductionDetail(memberVO.getIntroductionDetail());
        memberDO.setName(memberVO.getMemberName());
        return memberDO;
    }

}
